package cn.stylefeng.guns.modular.system.dao;

import cn.stylefeng.guns.modular.dto.ProxyUserDTO;
import cn.stylefeng.guns.modular.system.entity.UserInfoRes;
import cn.stylefeng.guns.sys.modular.system.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @ClassName ProxyUserMapper
 * @Author lzy
 * @Date 2020/1/6 11:39
 * @VERSION 1.0
 **/
@Repository
public interface ProxyUserMapper  extends BaseMapper<User> {

    void insertProxyUser(ProxyUserDTO build);


    List<UserInfoRes> findListByCondition(@Param("startTime") String startTime, @Param("endTime") String endTime,
                                          @Param("account") String account, @Param("name")String name, @Param("subUserIds")  List<String> subUserIds);

    void updateRate(@Param("userId") Long userId,@Param("feilv") BigDecimal feilv);

    void updateProxy(ProxyUserDTO build);

    void deleteProxy(@Param("id") Long id);

    Integer getAccountCount(@Param("phone")String phone);
	
	Integer getPhoneCount(@Param("phone") String phone);

    Map<String, Object> selectRelationByPid(String userId);

    int insertUserRelation(Map<String, Object> newUserRelationMap);

    List<String> findSubUserIdList(@Param("columnName")String columnName, @Param("ppid")String id);

    List<User> selectProxyByUserId(@Param("userId") String userId);


}
